home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / win / wpshell.zip / WPSINST.MS_ / WPSINST.MS
Text File  |  1995-01-04  |  23KB  |  583 lines

  1. '**************************************************************************
  2. '* MSSetup for Workplace Shell for Windows Install - Version 1.0
  3. '**************************************************************************
  4.  
  5. '$INCLUDE 'setupapi.inc'
  6. '$INCLUDE 'msdetect.inc'
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME         = 100
  10. CONST ASKQUIT         = 200
  11. CONST DESTPATH        = 300
  12. CONST EXITFAILURE     = 400
  13. CONST EXITQUIT        = 600
  14. CONST EXITSUCCESS     = 700
  15. CONST OPTIONS         = 800
  16. CONST APPHELP         = 900  ''WELCOME  Help
  17. CONST APPHELP1        = 903  ''DESTPATH  Help
  18. CONST APPHELP2        = 925  ''CUSTOM  Help
  19. CONST APPHELP3        = 908  ''RADIO  Help
  20. CONST CHECK           = 2500
  21. CONST BADPATH         = 6400
  22. CONST MB_YESNO        = 4
  23. CONST MB_ICONQUESTION = 32
  24. CONST IDYES           = 6
  25.  
  26.  
  27. ''Bitmap ID
  28. CONST LOGO = 1
  29.  
  30. GLOBAL DEST$        ''Default destination directory.
  31. GLOBAL OPTsel$      ''Option selection from option dialog.
  32. GLOBAL CHECKSTATES$ ''USED WITH custom OPTIONS
  33. GLOBAL WinDrive$
  34. GLOBAL CUIDLL$
  35. GLOBAL iUpgrade%
  36.  
  37. ' External function declarations.
  38. DECLARE FUNCTION WinExec Lib "KERNEL.EXE" (cmd$, show%) as Integer ''USED to kickoff pmtowp
  39. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
  40.  
  41. ' Private functions and subroutines declarations.
  42. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  43. DECLARE FUNCTION StrStr(szStr1$,szStr2$) AS INTEGER
  44. DECLARE SUB      AddPathString(szNewPath$)
  45. DECLARE SUB      AskTypeOfInstall
  46. DECLARE SUB      CheckForATM
  47. DECLARE SUB      Install
  48. DECLARE SUB      RebootSystem
  49.  
  50. szGetProcessorType$="You need at least an i386 architecture microprocessor to complete setup."
  51. szDoMsgBox$= "Workplace Shell for Windows Setup"
  52. INIT:
  53.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll - HAS EXTRA dBOX for A REAL CUSTOM
  54.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  55.  
  56.     SetBitmap CUIDLL$, LOGO
  57.     SetTitle "Workplace Shell for Windows Setup"
  58.  
  59. ''check what version of windows is installed.and kick out a box if it is 3.0
  60.     Major% = GetWindowsMajorVersion()
  61.     Minor% = GetWindowsMinorVersion()
  62.  
  63.     IF Major% < 3 OR (Major% = 3 AND Minor% < 10) THEN
  64.         i% = DoMsgBox("Microsoft Windows version 3.1 is required to install this product!",szDoMsgBox$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  65.         END
  66.     ENDIF
  67. 'check processor type - less than 386, message box it and abort
  68.     IF GetProcessorType < 3 THEN
  69.         i% = DoMsgBox(szGetProcessorType$,szDoMsgBox$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  70.         END
  71.     ENDIF
  72.  
  73.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  74.     IF szInf$ = "" THEN
  75.         szInf$ = GetSymbolValue("STF_CWDDIR") + "WPINST.INF"
  76.     END IF
  77.     ReadInfFile szInf$
  78.  
  79.     OldBeepMode% = SetBeepingMode (1)
  80.     SetCopyGaugePosition -1,75
  81.  
  82.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  83.     DEST$ = WinDrive + ":\WPSHELL"
  84.  
  85.     CheckStates$ = "CheckItemsOut"  ''SETUPSTRING FOR CHECK BOX
  86.  
  87.     FOR i% = 1 TO 4 STEP 1
  88.         AddListItem "CheckItemsIn", "ON"        ''SETTING ALL CHECK BOXES TO ON
  89.     NEXT i%
  90.  
  91.  
  92. WELCOME:
  93.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  94.     IF sz$ = "CONTINUE" THEN
  95.         UIPop 1
  96.     ELSE
  97.         GOSUB ASKQUIT
  98.         GOTO WELCOME
  99.     ENDIF
  100.  
  101.    ' Ask user if this is an upgrade or new install...
  102.    AskTypeOfInstall
  103.  
  104.    ' If user is upgrading from an older version of WPSFWIN...
  105.    IF iUpgrade% = IDYES THEN
  106.       ' Add "Checked" items to list.
  107.       AddListItem "CheckItemsOut", "OFF"    ' Migrate PROGMAN Desktop is "OFF"
  108.       AddListItem "CheckItemsOut", "ON"     ' Replace "Task Manager" with "Window List" is "ON"
  109.       AddListItem "CheckItemsOut", "OFF"    ' Set OS/2 Color Scheme as default color scheme is "OFF"
  110.       AddListItem "CheckItemsOut", "ON"     ' Make WPSFWIN the default Windows shell is "ON"
  111.       ' Skip the next two dialogs and ask for install path.
  112.       GOTO GETPATH
  113.    ENDIF
  114.  
  115. DIAGOPTS:
  116.     ''default for autoinstall
  117.      OPTsel$ = "1"
  118.     SetSymbolValue "RadioDefault", OPTsel$
  119. OPTL1:
  120.     sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP3, HELPPROC$)
  121.     OPTsel$ = GetSymbolValue("ButtonChecked")
  122.  
  123.     IF sz$ = "CONTINUE" THEN
  124.         UIPop(1)
  125.     ELSEIF sz$ = "REACTIVATE" THEN
  126.         GOTO OPTL1
  127.     ELSEIF sz$ = "BACK" THEN
  128.         UIPop 1
  129.         GOTO welcome
  130.     ELSE
  131.         GOSUB ASKQUIT
  132.         GOTO DIAGOPTS
  133.     ENDIF
  134.  
  135. regurgitate% = 1
  136.  
  137. IF OPTsel$ = "1" THEN
  138.     ' If user does express will use default all "ON"
  139.     FOR i% = 1 TO 4 STEP 1
  140.         AddListItem "CheckItemsOut", "ON"
  141.     NEXT i%
  142.     ' Getpath used twice/written twice when time tighten UP!!!
  143.     GOTO GETPATH
  144. ENDIF
  145.  
  146.  
  147. regurgitate% = 2
  148. CHECKIT:
  149.     sz$ = UIStartDlg(CUIDLL$, Check, "FCheckDlgProc", APPHELP2, HELPPROC$)
  150.  
  151. CHECKT1:
  152.     IF sz$ = "CONTINUE" THEN
  153.        UIPOP 1
  154.        GOTO GETPATH
  155.     ELSEIF sz$ = "REACTIVATE" THEN
  156.        GOTO CHECKT1
  157.     ELSEIF sz$ = "CHK1" THEN
  158.        GOTO CHECKT1
  159.     ELSEIF sz$ = "CHK2" THEN
  160.        GOTO CHECKT1
  161.     ELSEIF sz$ = "CHK3" THEN
  162.        GOTO CHECKT1
  163.     ELSEIF sz$ = "BACK" THEN
  164.        UIPop 1
  165.        GOTO DIAGOPTS
  166.     ELSE
  167.        GOSUB ASKQUIT
  168.        GOTO CHECKIT
  169.     ENDIF
  170.  
  171. GETPATH:
  172.         SetSymbolValue "EditTextIn", DEST$
  173.         SetSymbolValue "EditFocus", "END"
  174. GETPATHL1:
  175.         sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP1, HELPPROC$)
  176.         DEST$ = GetSymbolValue("EditTextOut")
  177.  
  178.         IF sz$ = "CONTINUE" THEN
  179.             IF IsDirWritable(DEST$) = 0 THEN
  180.                GOSUB BADPATH
  181.                GOTO GETPATHL1
  182.             END IF
  183.             UIPop 1
  184.         ELSEIF sz$ = "REACTIVATE" THEN
  185.             GOTO GETPATHL1
  186.         ELSEIF sz$ = "BACK" THEN
  187.             UIPop 1
  188.             if regurgitate = 1 then
  189.                 goto DIAGOPTS
  190.             ENDIF
  191.             GOTO CHECKIT
  192.         ELSE
  193.             GOSUB ASKQUIT
  194.             GOTO GETPATH
  195.         END IF
  196.  
  197. INSTALL1:
  198.         ' Check if user has Adobe Type Manager (ATM) drivers installed.
  199.         CheckForATM
  200.         ' Install product to destination directory.
  201.         Install
  202.  
  203. QUIT:
  204.     ON ERROR GOTO ERRQUIT
  205.  
  206.     IF ERR = 0 THEN
  207. QUITSUC:
  208.     sz$ = UIStartDlg(CUIDLL$, EXITSUCCESS, "FInfoDlgProc", APPHELP, HELPPROC$)
  209.         IF sz$ = "CONTINUE" THEN
  210.            'RebootSystem
  211.            'i% = DoMsgBox("There was an error configuring the system.  You must re-run setup.", "Workplace Shell for Windows Setup", MB_ICONEXCLAMATION+MB_OK+MB_TASKMODAL)
  212.            UIPopAll
  213.            END
  214.         ELSEIF sz$ = "REACTIVATE" THEN
  215.            GOTO QUITSUC
  216.         ELSE
  217.            GOSUB ASKQUIT
  218.            GOTO  QUITSUC
  219.         ENDIF
  220.     ELSEIF ERR = STFQUIT THEN
  221.         dlg% = EXITQUIT
  222.     ELSE
  223.         dlg% = EXITFAILURE
  224.     END IF
  225. QUITL1:
  226.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  227.     IF sz$ = "REACTIVATE" THEN
  228.         GOTO QUITL1
  229.     END IF
  230.     UIPop 1
  231.  
  232.     END
  233.  
  234. ERRQUIT:
  235.     i% = DoMsgBox("Setup sources were corrupted, read your Documentation for a number to contact.","Workplace Shell for Windows Installation", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  236.  
  237.     END
  238.  
  239.  
  240.  
  241. BADPATH:
  242.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  243.     IF sz$ = "REACTIVATE" THEN
  244.         GOTO BADPATH
  245.     END IF
  246.     UIPop 1
  247.     RETURN
  248.  
  249.  
  250.  
  251. ASKQUIT:
  252.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  253.  
  254.     IF sz$ = "EXIT" THEN
  255.         UIPopAll
  256.         ERROR STFQUIT
  257.     ELSEIF sz$ = "REACTIVATE" THEN
  258.         GOTO ASKQUIT
  259.     ELSE
  260.         UIPop 1
  261.     END IF
  262.     RETURN
  263.  
  264.  
  265. '**
  266. '** AskTypeOfInstall():
  267. '**
  268. '*************************************************************************
  269. SUB AskTypeOfInstall STATIC
  270.    iUpgrade% = DoMsgBox("Are you upgrading from an older version?","Upgrade Or New Install",MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION)
  271. END SUB
  272.  
  273. '**
  274. '** CheckForATM():
  275. '**
  276. '*************************************************************************
  277. SUB CheckForATM STATIC
  278.     Windir$ = GetWindowsDir()
  279.     SysLoc$ = Windir$ + "SYSTEM.INI"     'location and filename system.ini
  280.  
  281.     ' Read in "system.drv=" line from SYSTEM.INI file.
  282.     SysDriver$ = GetIniKeyString(SysLoc$,"boot","system.drv")
  283.     ATMSysDriver$ = GetIniKeyString(SysLoc$,"boot","atm.system.drv")
  284.     ' Check if ATM drivers are loaded.
  285.     IF (SysDriver$ = "atmsys.drv") OR (ATMSysDriver$ = "system.drv") THEN
  286.        ' Notify and ask user if changes should be made.
  287.        iResult% = DoMsgBox("You have the Adobe Type Manager (ATM) driver installed."+CHR$(10)+"We need to comment out the driver in order to work correctly."+CHR$(10)+"Do you want this done for you?",szDoMsgBox$,MB_YESNO+MB_TASKMODAL+MB_ICONQUESTION)
  288.        IF iResult% = IDYES THEN
  289.           '  Add ';' to comment out both lines.
  290.           RemoveIniKey  SysLoc$, "boot","system.drv",cmoVital
  291.           RemoveIniKey  SysLoc$, "boot","atm.system.drv",cmoVital
  292.           CreateIniKeyValue SysLoc$,"boot",";system.drv",SysDriver$,cmoAppend + cmoVital
  293.           CreateIniKeyValue SysLoc$,"boot",";atm.system.drv",ATMSysDriver$,cmoAppend + cmoVital
  294.        ENDIF
  295.     ENDIF
  296. END SUB
  297.  
  298.  
  299. '**
  300. '** Purpose:
  301. '**     Builds the copy list and performs all installation operations.
  302. '** Arguments:
  303. '**     none.
  304. '** Returns:
  305. '**     none.
  306. '*************************************************************************
  307. SUB Install STATIC
  308.    windir$ = GetWindowsDir()
  309.    SrcDir$ = GetSymbolValue("STF_SRCDIR")
  310.    sysdir$ = GetWindowsSysDir()
  311.    CreateDir DEST$, cmoVITAL
  312.    SetRestartDir windir$
  313.    SysLoc$ = windir$ + "system.ini"     'location and filename system.ini
  314.    CopyFile SysLoc$, DEST$ + "\system.bak",cmoVital,0
  315.  
  316.    ClearCopyList
  317.    AddSectionFilesToCopyList "store", SrcDir$, DEST$
  318.    AddSectionFilesToCopyList "systm", SrcDir$, sysdir$
  319.    AddSectionFilesToCopyList "windows", SrcDir$, windir$
  320.  
  321.    ' Query current language used in Windows.
  322.    Language$ = GetIniKeyString(windir$ + "win.ini","intl","sLanguage")
  323.  
  324.    ' By default, assign english title to "System Setup" string.
  325.    SystemSetup$ = "System Setup"
  326.  
  327.    ' If portuguese...
  328.    IF (Language$ = "ptg") OR (Lamguage$ = "ptb") THEN
  329.       ' Add language dependent files to copy list.
  330.       AddSectionFilesToCopyList "nls_port", SrcDir$, DEST$
  331.       SystemSetup$ = "Configuraτπo do sistema"
  332.    ' If dutch...
  333.    ELSEIF Language$ = "nld" THEN
  334.       ' Add language dependent files to copy list.
  335.       AddSectionFilesToCopyList "nls_dutc", SrcDir$, DEST$
  336.       SystemSetup$ = "Systeem instellingen"
  337.  
  338. ' ******* COMMENTED OUT *******
  339. '   ' If danish...
  340. '   ELSEIF Language$ = "dan" THEN
  341. '      Add language dependent files to copy list.
  342. '      AddSectionFilesToCopyList "nls_dani", SrcDir$, DEST$
  343. '   ' If german...
  344. '   ELSEIF Language$ = "deu" THEN
  345. '      ' Add language dependent files to copy list.
  346. '      AddSectionFilesToCopyList "nls_grmn", SrcDir$, DEST$
  347. '   ' If spanish...
  348. '   ELSEIF (Language$ = "esn") OR (Language$ = "esp")  THEN
  349. '      ' Add language dependent files to copy list.
  350. '      AddSectionFilesToCopyList "nls_span", SrcDir$, DEST$
  351. '   ' If french...
  352. '   ELSEIF (Language$ = "fra") OR (Language$ = "frc")  THEN
  353. '      ' Add language dependent files to copy list.
  354. '      AddSectionFilesToCopyList "nls_fren", SrcDir$, DEST$
  355. ' ****** COMMENTED OUT *******
  356.  
  357.    ' Else US-english....
  358.    ELSE
  359.       ' Add language dependent files to copy list.
  360.       AddSectionFilesToCopyList "nls_enus", SrcDir$, DEST$
  361.       SystemSetup$ = "System Setup"
  362.    ENDIF
  363.  
  364.    ' If user wants us to replace the current Task Manager with Window List...
  365.    IF GetListItem(CheckStates$, 2) = "ON" THEN
  366.       ' Set the "taskman=" key value to the "Window List" program ("wndlist.exe").
  367.       CreateIniKeyValue  SysLoc$, "boot","taskman.exe",DEST$+ "\wndlist.exe",cmoOverwrite + cmoVital
  368.    ENDIF
  369.  
  370.    ' If user wants us to setup the OS/2 color scheme as the default color scheme...
  371.    IF GetListItem(CheckStates$, 3) = "ON" THEN
  372.         'we would copy bmp to windir, change sys.ini and change color scheme,  else copy to dest$
  373.         ' color scheme has not been created yet-add later
  374.         AddSectionFilesToCopyList "bmp", SrcDir$, DEST$
  375.         ' Backup *.INI files.
  376.         CopyFile windir$ + "win.ini", DEST$ + "\win.bak",cmoVital,0
  377.         CopyFile windir$ + "control.ini", DEST$ + "\control.bak",cmoVital,0
  378.  
  379.         ' Make the OS/2 Warp color scheme the current color scheme.
  380.         CreateIniKeyValue windir$ + "control.ini","current","color schemes","OS\2 Warp",cmoOverwrite + cmoVital
  381.  
  382.         ' Add the OS/2 2.x and OS/2 Warp color schemes to color scheme list.
  383.         CreateIniKeyValue windir$ + "control.ini", "Color Schemes","OS\2 Warp","808000,E8FFFF,FFFFFF,0,C0C0C0,0,800040,C0C0C0,FFFFFF,C0C0C0,C0C0C0,0,C0C0C0,C0C0C0,808080,0,808080,808080,FFFFFF,808080,FFFFFF",cmoAppend + cmoVital
  384.         CreateIniKeyValue windir$ + "control.ini", "Color Schemes","OS\2","C0C0C0,E8FFFF,FFFFFF,0,C0C0C0,0,808040,C0C0C0,FFFFFF,80FFFF,C0C0C0,0,C0C0C0,C0C0C0,808080,0,808080,808080,FFFFFF,808080,FFFFFF",cmoAppend + cmoVital
  385.  
  386.         ' Make the OS/2 Warp colors the default color.
  387.         CreateIniKeyValue windir$ + "win.ini","Colors","Background","0 128 128",cmoOverwrite + cmoVital
  388.         CreateIniKeyValue windir$ + "win.ini","Colors","AppWorkspace", "255 255 232",cmoOverwrite + cmoVital
  389.         CreateIniKeyValue windir$ + "win.ini","Colors", "Window","255 255 255",cmoOverwrite + cmoVital
  390.         CreateIniKeyValue windir$ + "win.ini","Colors","WindowText","0 0 0",cmoOverwrite + cmoVital
  391.         CreateIniKeyValue windir$ + "win.ini","Colors","Menu","192 192 192",cmoOverwrite + cmoVital
  392.         CreateIniKeyValue windir$ + "win.ini","Colors","MenuText","0 0 0",cmoOverwrite + cmoVital
  393.         CreateIniKeyValue windir$ + "win.ini","Colors","ActiveTitle","64 0 128",cmoOverwrite + cmoVital
  394.         CreateIniKeyValue windir$ + "win.ini","Colors","InactiveTitle","192 192 192",cmoOverwrite + cmoVital
  395.         CreateIniKeyValue windir$ + "win.ini","Colors","TitleText","255 255 255",cmoOverwrite + cmoVital
  396.         CreateIniKeyValue windir$ + "win.ini","Colors","ActiveBorder","192 192 192",cmoOverwrite + cmoVital
  397.         CreateIniKeyValue windir$ + "win.ini","Colors","InactiveBorder","192 192 192",cmoOverwrite + cmoVital
  398.         CreateIniKeyValue windir$ + "win.ini","Colors","WindowFrame","0 0 0",cmoOverwrite + cmoVital
  399.         CreateIniKeyValue windir$ + "win.ini","Colors","ScrollBar","192 192 192",cmoOverwrite + cmoVital
  400.         CreateIniKeyValue windir$ + "win.ini","Colors","ButtonFace","192 192 192",cmoOverwrite + cmoVital
  401.         CreateIniKeyValue windir$ + "win.ini","Colors","ButtonShadow","128 128 128",cmoOverwrite + cmoVital
  402.         CreateIniKeyValue windir$ + "win.ini","Colors","ButtonText","0 0 0",cmoOverwrite + cmoVital
  403.         CreateIniKeyValue windir$ + "win.ini","Colors","GrayText","128 128 128",cmoOverwrite + cmoVital
  404.         CreateIniKeyValue windir$ + "win.ini","Colors","Hilight","128 128 128",cmoOverwrite + cmoVital
  405.         CreateIniKeyValue windir$ + "win.ini","Colors","HilightText","255 255 255",cmoOverwrite + cmoVital
  406.         CreateIniKeyValue windir$ + "win.ini","Colors","InactiveTitleText","128 128 128",cmoOverwrite + cmoVital
  407.         CreateIniKeyValue windir$ + "win.ini","Colors","ButtonHilight","255 255 255",cmoOverwrite + cmoVital
  408.    ELSE
  409.         ' Backup *.INI files.
  410.         CopyFile windir$ + "win.ini", DEST$ + "\win.bak",cmoVital,0
  411.         CopyFile windir$ + "control.ini", DEST$ + "\control.bak",cmoVital,0
  412.         ' Add the OS/2 2.x and OS/2 Warp color schemes to color scheme list.
  413.         CreateIniKeyValue windir$ + "control.ini", "Color Schemes","OS\2 Warp","808000,E8FFFF,FFFFFF,0,C0C0C0,0,800040,C0C0C0,FFFFFF,C0C0C0,C0C0C0,0,C0C0C0,C0C0C0,808080,0,808080,808080,FFFFFF,808080,FFFFFF",cmoAppend + cmoVital
  414.         CreateIniKeyValue windir$ + "control.ini", "Color Schemes","OS\2","C0C0C0,E8FFFF,FFFFFF,0,C0C0C0,0,808040,C0C0C0,FFFFFF,80FFFF,C0C0C0,0,C0C0C0,C0C0C0,808080,0,808080,808080,FFFFFF,808080,FFFFFF",cmoAppend + cmoVital
  415.  
  416.         AddSectionFilesToCopyList "bmp", SrcDir$, DEST$
  417.    ENDIF
  418.  
  419.    CopyFilesInCopyList
  420.  
  421.    ' If user wants us to make WPSFWIN the current default Windows shell...
  422.    IF GetListItem(CheckStates$, 4) = "ON" THEN
  423.         'change sys.ini to reflect current changes
  424.         ' String$=GetIniKeyString(szFile$,szSect$,szKey$)  -gotta put a ; infront of current shell= ??, this is a start
  425.         OldShell$=GetIniKeyString(SysLoc$,"boot","shell")
  426.         CreateIniKeyValue  SysLoc$, "boot","shell",DEST$+ "\wpshell.exe",cmoOverwrite + cmoVital
  427.         CreateIniKeyValue SysLoc$,"boot",";shell",OldShell$,cmoAppend + cmoVital
  428.    ENDIF
  429.  
  430.    ' If user wants us to automatically migrate their PROGMAN desktop...
  431.    IF GetListItem(CheckStates$, 1) = "ON" THEN
  432.         ' Setup call to conversion utility and parameters...
  433.         IF GetListItem(CheckStates$, 3) = "ON" THEN
  434.            ' OS/2 Warp colors are being installed as default.
  435.            Exe1$ = dest$ + "\PMTOWP.EXE /s /w"
  436.         ELSE
  437.            ' No OS/2 color schemes are being installed as default.
  438.            Exe1$ = dest$ + "\PMTOWP.EXE /s"
  439.         ENDIF
  440.         ' Run PMTOWP.EXE (Program Manager to Workplace Shell) conversion utility.
  441.         i%= WinExec(EXE1$, SW_SHOW)
  442.    ENDIF
  443.  
  444.    ' Create WPSFWIN system entries in SYSTEM.INI.
  445.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","DESKTOP_HorzIconIndent","23",cmoVital
  446.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","DESKTOP_VertIconIndent","5",cmoVital
  447.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","SYSTEM_ConfirmOnFolderDelete","Yes",cmoVital
  448.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","SYSTEM_ConfirmOnDelete","Yes",cmoVital
  449.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","SYSTEM_Animation","Enabled",cmoVital
  450.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","SYSTEM_ButtonApperance","Hide",cmoVital
  451.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","SYSTEM_MinBehavior","Hide",cmoVital
  452.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","SYSTEM_OpenBehavior","CreateNew",cmoVital
  453.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","SYSTEM_SystemSetupFolderName",SystemSetup$,cmoVital
  454.    CreateIniKeyValue SysLoc$,"Workplace_Shell_for_Windows","COLOR_ShadowText","FF0000",cmoVital
  455.  
  456.    ' WIN.INI System Events Sounds entries.
  457.    CreateIniKeyValue windir$ + "win.ini", "sounds","WPFolderClose",",Workplace Shell Close Folder",cmoVital
  458.    CreateIniKeyValue windir$ + "win.ini", "sounds","WPFolderOpen",",Workplace Shell Open Folder",cmoVital
  459.    CreateIniKeyValue windir$ + "win.ini", "sounds","WPBeginDrag",",Workplace Shell Begin Drag",cmoVital
  460.    CreateIniKeyValue windir$ + "win.ini", "sounds","WPEndDrag",",Workplace Shell End Drag",cmoVital
  461.    CreateIniKeyValue windir$ + "win.ini", "sounds","WPShred",",Workplace Shell Shred",cmoVital
  462.  
  463.    ' Convert WPSHELL.INI file to new format if upgrading.
  464.    IF iUpgrade% = IDYES THEN
  465.       i% = WinExec(dest$+"\CONVINI.EXE /s", SW_SHOW)
  466.    ENDIF
  467.  
  468. END SUB
  469.  
  470.  
  471. '**********************************************************************************************************************************************
  472. SUB RebootSystem STATIC
  473.  
  474. '   Check if any files were locked during install.  If the RestartList
  475. '   is not empty, ExitExecRestart() will restart Windows, cleanup setup
  476. '   files, and copy over locked files before Windows restarts.
  477.     i% = RestartListEmpty()
  478.     IF i% = 0 THEN
  479. '      ExitExecRestart() only returns if applications refuse to be shutdown.
  480. '      Win32s is installed but will not operate until Windows is restarted
  481. '      and the Win32s VxD is loaded.
  482.          z% = ExitExecRestart()
  483.         WHILE z% = 0
  484. QUITSUC1:
  485.            sz$ = UIStartDlg(CUIDLL$, EXITSUCCESS, "FInfoDlgProc", APPHELP, HELPPROC$)
  486.            IF sz$ = "CONTINUE" THEN
  487.                z% = ExitExecRestart()
  488.                UIPop 1
  489.            ELSEIF sz$ = "REACTIVATE" THEN
  490.                GOTO QUITSUC1
  491.            ELSEIF sz$ = "CANCEL" THEN
  492.                GOTO QUITSUC1
  493.            END IF
  494.         WEND
  495.     ELSE
  496. '      If the RestartList list is empty, it is necessary to restart windows
  497. '      directly.  The MSSETUP program creates _MSRSTRT.EXE and _MSSETUP.BAT
  498. '      in the restart directory.  This program should be exec'd to handle
  499. '      proper MSSETUP cleanup (temp files) and restart Windows.
  500.            z% =ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
  501.           WHILE z% = 0
  502. QUITSUC2:
  503.              sz$ = UIStartDlg(CUIDLL$, EXITSUCCESS, "FInfoDlgProc", APPHELP, HELPPROC$)
  504.              IF sz$ = "CONTINUE" THEN
  505.                  z% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
  506.                  UIPop 1
  507.              ELSEIF sz$ = "REACTIVATE" THEN
  508.                  GOTO QUITSUC2
  509.            ELSEIF sz$ = "CANCEL" THEN
  510.                GOTO QUITSUC2
  511.              END IF
  512.           WEND
  513.     ENDIF
  514.  
  515. END SUB
  516.  
  517. '*************************************************************************
  518.  
  519.  
  520.  
  521. '**
  522. '** Purpose:
  523. '**     Appends a file name to the end of a directory path,
  524. '**     inserting a backslash character as needed.
  525. '** Arguments:
  526. '**     szDir$  - full directory path (with optional ending "\")
  527. '**     szFile$ - filename to append to directory
  528. '** Returns:
  529. '**     Resulting fully qualified path name.
  530. '*************************************************************************
  531. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  532.     IF szDir$ = "" THEN
  533.         MakePath = szFile$
  534.     ELSEIF szFile$ = "" THEN
  535.         MakePath = szDir$
  536.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  537.         MakePath = szDir$ + szFile$
  538.     ELSE
  539.         MakePath = szDir$ + "\" + szFile$
  540.     END IF
  541. END FUNCTION
  542.  
  543.  
  544. '**
  545. '** Purpose:
  546. '** Arguments:
  547. '** Returns:
  548. '*************************************************************************
  549. FUNCTION StrStr(szStr1$,szStr2$) STATIC AS INTEGER
  550.    ' If either string is empty, exit immediatedly.
  551.    IF (szStr1$ <> "") AND (szStr2$ <> "") THEN
  552.       FOR i% = 1 TO LEN(szStr1$) STEP 1
  553.             IF MID$(szStr1$,i%,LEN(szStr2$)) = szStr2$ THEN
  554.                StrStr = 1
  555.                GOTO STRSTR_END
  556.             ENDIF
  557.       NEXT i%
  558.    ENDIF
  559.  
  560.    StrStr = 0
  561.  
  562. STRSTR_END:
  563.  
  564. END FUNCTION
  565.  
  566.  
  567. '**
  568. '** Purpose:
  569. '** Arguments:
  570. '** Returns:
  571. '*************************************************************************
  572. SUB AddPathString(szNewPath$) STATIC
  573.  
  574.    szCurrentPath$ = GetEnvVariableValue("PATH")
  575.  
  576.    IF StrStr(szCurrentPath$,szNewPath$) = 0 THEN
  577.       'PrependToPath "AUTOEXEC.BAT","AUTOEXEC.BAT",szNewPath$,cmoVital + cmoOverwrite
  578.    ENDIF
  579.  
  580. END SUB
  581.  
  582.  
  583.